#ifndef _PLAY_H
#define _PLAY_H
#include "arm_2d.h"
#include "example_gui.h"
#include "app_platform.h"
#include "arm_2d_helper.h"
#include "DEV_Config.h"
#include "hardware/gpio.h"
#define		DIRECTION_RIGHT  20
#define		DIRECTION_DOWN   18
#define		DIRECTION_LEFT   16
#define		DIRECTION_UP     2
#define		DIRECTION_CTRL   3
#define 	DIRECTION_KEY_A  15 
#define 	DIRECTION_KEY_B  17 
#define 	DIRECTION_KEY_X  19 
#define 	DIRECTION_KEY_Y  21


extern uint8_t   MOVING_SPEED_iX ;

typedef struct{
		uint32_t iX;
		uint8_t iHight;
		uint8_t iGap;
		uint8_t char_arm_2d;
		uint8_t mode;

}play_obstacle_t;

extern const uint8_t Font_6x8_h[(144-32)*8];
extern const arm_2d_tile_t c_tileHuo;
extern play_obstacle_t play_obstacle[2] ;
extern arm_2d_location_t tplay_X_Y;
extern arm_2d_region_t tBird;
extern const arm_2d_tile_t c_tilePaoShang;
extern const arm_2d_tile_t c_tilePaoDi;
extern const arm_2d_tile_t c_tileLazhu;
extern  const arm_2d_tile_t c_tileHudie;
extern const arm_2d_tile_t c_tileHudie2;
extern const arm_2d_tile_t c_tileMeigui2;
extern const arm_2d_tile_t c_tileMeigui;

void print_char(const arm_2d_tile_t *ptTile,char zhi,int16_t lx,uint8_t ly,uint8_t size);
void test_paly_game_gui_refresh(const arm_2d_tile_t *ptTile, bool bIsNewFrame);
void play_game();
uint8_t get_key();
void key_init();
void new_obstacle(uint8_t i);
void mysrand(unsigned seed) ;
int myrand(void) ;
void test_line_mask(const arm_2d_tile_t *ptFrameBuffer);
void init_line_mask();

#endif
